<?php

namespace common\widgets\grid;

/**
 * Class ActionColumn
 *
 * @package common\widgets\grid
 */
class ActionColumn extends \kartik\grid\ActionColumn
{

    public $isShow;

    /**
     * {@inheritdoc}
     */
    public $template = '{update} {delete}';

    /**
     * {@inheritdoc}
     */
    protected function renderDataCellContent($model, $key, $index)
    {
        $content = parent::renderDataCellContent($model, $key, $index);
        if (is_callable($this->isShow))
        {
            if (call_user_func_array($this->isShow, [$model, $key, $index]) == false)
            {
                $content = "";
            }
        }
        return $content;
    }
}
